# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=libopusenc
pkgver=0.2.1
pkgrel=3
pkgdesc="High-level API for encoding .opus files"
arch=('loong64' 'x86_64')
url="https://opus-codec.org/"
license=('BSD')
depends=('glibc' 'opus')
options=('staticlibs')
source=("https://archive.mozilla.org/pub/opus/libopusenc-$pkgver.tar.gz")
#source=("https://ftp.osuosl.org/pub/xiph/releases/opus/libopusenc-$pkgver.tar.gz")
sha256sums=('8298db61a8d3d63e41c1a80705baa8ce9ff3f50452ea7ec1c19a564fe106cbb9')

build() {
  cd "$pkgname-$pkgver"

  CFLAGS+=" -ffat-lto-objects" \
  ./configure --prefix="/usr"
  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  install -Dm644 "COPYING" "$pkgdir/usr/share/licenses/libopusenc/COPYING"
  rm -rf "$pkgdir/usr/share/doc"
}
